package org.example.springiocdemo.LoggerController;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logger")
public class LoggerController {
    private Logger logger= LoggerFactory.getLogger(LoggerController.class);
    @RequestMapping("/print")
    public String print(){
//        logger.info("打印日志");
        logger.trace("我是trace级别的日志");
        logger.debug("我是debug级别的日志");
        logger.info("我是info级别的日志");
        logger.warn("我是warn级别的日志");
        logger.error("我是error级别的日志");
        return "打印日志成功";
    }
}
